<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <ul>
      <li></li>
      <li></li>
      <li></li>
    </ul>
  </body>
  <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.4/jquery.js"></script>
  <script>
    $("ul li").each(function (index, dom) {
      console.log(index, dom); //dom为一个li标签 用$()可以拿到节点
      $(dom).html("这是列表项" + index); //$() 括号内为变量不加引号，为常量加""
    });
  </script>
</html>
